package com.example.javaend;

import com.example.javaend.Config.Config;
import generator.domain.t_user;
import generator.mapper.t_userMapper;
import generator.service.impl.t_userServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class JavaEndApplication {

    @Autowired
    private Config config;


    public static void main(String[] args) {
        // 启动Spring Boot应用
        ConfigurableApplicationContext context = SpringApplication.run(JavaEndApplication.class, args);
        //Config gurable App Context
        // 获取Spring应用上下文中的JavaEndApplication实例
        JavaEndApplication application = context.getBean(JavaEndApplication.class);

        // 打印启动信息
        System.out.println("启动成功");
        System.out.println("访问地址: http://localhost:" + application.config.getPort());
        System.out.println("数据库地址: " + application.config.getMysql_url());
        System.out.println("数据库用户名: " + application.config.getMysql_username());
        System.out.println("数据库密码: " + application.config.getMysql_password());



    }
}